<#compress>
<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>VR实训</title>
    <link rel="stylesheet" href="${base}/css/common.css">
    <link rel="stylesheet" href="${base}/css/login.css">

    <script src="https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>

</head>
<body>
<div class="login">
    <img src="${base}/images/raw_1530840480.png">
    <p>四川司法警官职业技术学院</p>
</div>
<div class="login_input">
    <p><img src="${base}/images/raw_1530840536.png" alt=""><input type="text" id="username" placeholder="手机号"></p>
    <p><img src="${base}/images/raw_1530840599.png" alt=""><input type="password" id="pwd" placeholder="密码"></p>
</div>
<div class="btn"><a href="javascript:;" onclick="sublogin()">登 陆</a></div>
<script>
    function sublogin() {
        var username=$('#username').val();
        var password=$('#pwd').val();
        if(username && password){
            $.post('${base}/common/login',{username:username,password:password,openid:'${openid}'},function (result) {
                if(result.code==0){
                    if(result.extra.type=='1'){
                        window.location.href = '${mobile_redirectUrl}?token='+result.extra.access_token;
                    }else if(result.extra.type=='2'){
                        window.location.href = '${teacher_redirectUrl}?token='+result.extra.access_token;
                    }
                }else{
                    alert(result.message)
                }
            });
        }
        
    }
</script>
</body>
</html>
</#compress>